#D:\E盘\study\python\jf_code
try:
    with open('D:\E盘\study\python\jf_code\password.txt','r+') as fd:
        Passwd = fd.readline()
        flage=0
        while (flage<3):
            InputPasswd = input("请输入密码：")
            if Passwd == InputPasswd:
                print("恭喜你密码输入正确。")
                break
            if Passwd != InputPasswd:
                flage += 1
                if flage == 3:
                    print("密码错误，无法再次输入。")
                    break
                print("密码错误！！还有%s次机会输入" %(3-flage))
                continue
except:
    print("密码文件出问题啦！！请检查密码文件！！")
        
       

